<?php
namespace JJ;

class JJ
{
    static function run()
    {
        spl_autoload_register('self::autoLoad');
        Route::to();
    }

    static function autoLoad($class)
    {
        static $map;
        if (isset($map[$class])) {
            return;
        }
        $file = '.\\' . $class . '.php';
        $file = strtr($file, '\\', DIRECTORY_SEPARATOR);
        if (file_exists($file)) {
            include $file;
        }
    }
}
